import request from "@/utils/request";


export function getXiaoshouList(data) {
	return request({
		url: "/api/v1/marketing/customer/getXiaoshouList",
		method: "get",
		params: data,
	});
}

export function getList(data) {
	return request({
		url: "/api/v1/marketing/customer/findPage",
		method: "get",
		params: data,
	});
}

export function getListByMy(data) {
	return request({
		url: "/api/v1/marketing/customer/findPageByMy",
		method: "get",
		params: data,
	});
}

export function getListBySortType(data) {
	return request({
		url: "/api/v1/marketing/customer/getListBySortTypePage",
		method: "get",
		params: data,
	});
}

export function denglujiazhang(data) {
	return request({
		url: "/api/v1/marketing/customer/denglujiazhang",
		method: "get",
		params: data,
	});
}

export function getListByParentOrStudent(params) {
	return request({
		url: "/api/v1/marketing/customer/getListByParentOrStudent",
		method: "get",
		params,
	});
}

export function getListByPhoneFromAllOrg(params) {
	return request({
		url: "/api/v1/marketing/customer/getListByPhoneFromAllOrg",
		method: "get",
		params,
	});
}

export function doInsert(data) {
	return request({
		url: "/api/v1/marketing/customer/insert",
		method: "post",
		data,
		task: true,
	});
}

export function UserPlan(data) {
	return request({
		url: "/api/v1/marketing/customer/UserPlan",
		method: "post",
		data,
	});
}

export function getImportExcelField() {
	return request({
		url: "/api/v1/marketing/customer/getImportExcelField",
		method: "get",
	});
}

export function zhipai(data) {
	return request({
		url: "/api/v1/marketing/customer/zhipai",
		method: "post",
		data,
	});
}

export function zhudai(data) {
	return request({
		url: "/api/v1/marketing/customer/zhudai",
		method: "post",
		data,
	});
}

export function doUpdate(data) {
	return request({
		url: "/api/v1/marketing/customer/update",
		method: "post",
		data,
		task: true
	});
}

export function doDelete(data) {
	return request({
		url: "/api/v1/marketing/customer/del",
		method: "post",
		params: data,
	});
}

export function doDeleteAll(data) {
	return request({
		url: "/api/v1/marketing/customer/delAll",
		method: "post",
		params: data,
	});
}

export function guihuan(data) {
	return request({
		url: "/api/v1/marketing/customer/guihuan",
		method: "post",
		params: data,
	});
}

/**
 * 导出Excel 目前只支持一层参数传递
 * @param data
 * @returns file
 */
export function doExportExcel(data) {
	let requestURL = "/api/v1/marketing/customer/exportExcel";
	// 下载文件
	downloadFileByData(requestURL, data);
}

/**
 * 下载模版
 * @returns file
 */
export function doDownloadTemplate(data) {
	let requestURL = "/api/v1/marketing/customer/importExcel/template";
	// 下载文件
	downloadFileByData(requestURL, data);
}

/**
 * 导入Excel
 * @returns file
 */
export function doImportExcel(data) {
	return request({
		url: "/api/v1/marketing/customer/importExcel",
		method: "post",
		// 最长超时时间 3 分钟
		timeout: 180000,
		headers: {
			"Content-Type": "multipart/form-data",
		},
		data,
	});
}